# coding=utf8

# Copyright 2018 JDCLOUD.COM
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# NOTE: This class is auto generated by the jdcloud code generator program.

from jdcloud_sdk.core.jdcloudrequest import JDCloudRequest


class PurgeFilesByCache_TagsAndHostOrPrefixRequest(JDCloudRequest):
    """
    通过指定主机、关联的缓存标记或前缀，从星盾的缓存中精确删除一个或多个文件。
注意，缓存标记、主机和前缀清除每24小时的速率限制为30000次清除API调用。一次API调用最多可以清除30个标记、主机或前缀。
对于需要以更大容量进行清除的客户，可以提高此速率限制。

    """

    def __init__(self, parameters, header=None, version="v1"):
        super(PurgeFilesByCache_TagsAndHostOrPrefixRequest, self).__init__(
            '/zones/{identifier}/purge_cache__purgeFilesByCache_TagsAndHostOrPrefix', 'POST', header, version)
        self.parameters = parameters


class PurgeFilesByCache_TagsAndHostOrPrefixParameters(object):

    def __init__(self,identifier, ):
        """
        :param identifier: 
        """

        self.identifier = identifier
        self.tags = None
        self.hosts = None
        self.prefixes = None

    def setTags(self, tags):
        """
        :param tags: (Optional) 如何资产携带Cache-Tag头，并且它的值与提供的值之一匹配的话，该资产将从星盾缓存中清除
        """
        self.tags = tags

    def setHosts(self, hosts):
        """
        :param hosts: (Optional) 如果资产的URL中的host与提供的值之一匹配的话，该资产将从星盾缓存中清除
        """
        self.hosts = hosts

    def setPrefixes(self, prefixes):
        """
        :param prefixes: (Optional) URL上与前缀匹配的任何资产都将从星盾缓存中清除。
例如, a.com/b 意味着 a.com/b/c/d.png 会被删除，而 a.com/bc.png 不会被删除。前缀a.com/b和a.com/b/c是冗余的。

        """
        self.prefixes = prefixes

